/*
 Navicat Premium Data Transfer

 Source Server         : docker
 Source Server Type    : MySQL
 Source Server Version : 80100 (8.1.0)
 Source Host           : localhost:3307
 Source Schema         : pw

 Target Server Type    : MySQL
 Target Server Version : 80100 (8.1.0)
 File Encoding         : 65001

 Date: 19/10/2023 17:52:14
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for admin_menu
-- ----------------------------
DROP TABLE IF EXISTS `admin_menu`;
CREATE TABLE `admin_menu` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `menu_type` tinyint NOT NULL DEFAULT '0' COMMENT '类型（0:菜单，1:按钮）',
  `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '路由路径',
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '菜单名称',
  `component` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '组件路由',
  `redirect` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '重定向',
  `title` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
  `is_link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '链接地址',
  `is_hide` tinyint NOT NULL DEFAULT '0',
  `is_keep_alive` tinyint NOT NULL DEFAULT '0',
  `is_affix` tinyint NOT NULL DEFAULT '0',
  `is_iframe` tinyint NOT NULL DEFAULT '0',
  `icon` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '图标',
  `parent_id` int unsigned NOT NULL DEFAULT '0' COMMENT '父级菜单id',
  `parent_path` json NOT NULL,
  `sort` int NOT NULL DEFAULT '0' COMMENT '排序',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ux_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of admin_menu
-- ----------------------------
BEGIN;
INSERT INTO `admin_menu` (`id`, `menu_type`, `path`, `name`, `component`, `redirect`, `title`, `is_link`, `is_hide`, `is_keep_alive`, `is_affix`, `is_iframe`, `icon`, `parent_id`, `parent_path`, `sort`, `created_at`, `updated_at`) VALUES (1, 0, '/home', 'home', 'home/index', '', 'message.router.home', '', 0, 1, 1, 0, 'iconfont icon-shouye', 0, 'null', 1, '2023-10-12 08:51:57', '2023-10-15 08:04:02');
INSERT INTO `admin_menu` (`id`, `menu_type`, `path`, `name`, `component`, `redirect`, `title`, `is_link`, `is_hide`, `is_keep_alive`, `is_affix`, `is_iframe`, `icon`, `parent_id`, `parent_path`, `sort`, `created_at`, `updated_at`) VALUES (2, 0, '/system', 'system', 'layout/routerView/parent', '/system/menu', 'message.router.system', '', 0, 1, 0, 0, 'iconfont icon-xitongshezhi', 0, 'null', 1, '2023-10-12 09:06:28', '2023-10-18 03:44:35');
INSERT INTO `admin_menu` (`id`, `menu_type`, `path`, `name`, `component`, `redirect`, `title`, `is_link`, `is_hide`, `is_keep_alive`, `is_affix`, `is_iframe`, `icon`, `parent_id`, `parent_path`, `sort`, `created_at`, `updated_at`) VALUES (3, 0, '/system/menu', 'systemMenu', 'system/menu/index', '', 'message.router.systemMenu', '', 0, 1, 0, 0, 'iconfont icon-caidan', 2, '[\"2\"]', 0, '2023-10-12 09:12:38', '2023-10-14 05:39:05');
INSERT INTO `admin_menu` (`id`, `menu_type`, `path`, `name`, `component`, `redirect`, `title`, `is_link`, `is_hide`, `is_keep_alive`, `is_affix`, `is_iframe`, `icon`, `parent_id`, `parent_path`, `sort`, `created_at`, `updated_at`) VALUES (4, 1, '', 'systemMenuAdd', '', '', 'message.router.systemMenuAdd', '', 0, 0, 0, 0, '', 3, '[\"2\", \"3\"]', 0, '2023-10-13 06:46:30', '2023-10-19 04:00:14');
INSERT INTO `admin_menu` (`id`, `menu_type`, `path`, `name`, `component`, `redirect`, `title`, `is_link`, `is_hide`, `is_keep_alive`, `is_affix`, `is_iframe`, `icon`, `parent_id`, `parent_path`, `sort`, `created_at`, `updated_at`) VALUES (6, 0, '/system/role', 'systemRole', 'system/role/index', '', 'message.router.systemRole', '', 0, 1, 0, 0, 'ele-ColdDrink', 2, '[\"2\"]', 0, '2023-10-14 11:11:47', '2023-10-14 11:14:39');
INSERT INTO `admin_menu` (`id`, `menu_type`, `path`, `name`, `component`, `redirect`, `title`, `is_link`, `is_hide`, `is_keep_alive`, `is_affix`, `is_iframe`, `icon`, `parent_id`, `parent_path`, `sort`, `created_at`, `updated_at`) VALUES (7, 0, '/system/user', 'systemUser', 'system/user/index', '', 'message.router.systemUser', '', 0, 1, 0, 0, 'iconfont icon-icon-', 2, '[\"2\"]', 0, '2023-10-14 11:14:20', '2023-10-16 08:47:01');
INSERT INTO `admin_menu` (`id`, `menu_type`, `path`, `name`, `component`, `redirect`, `title`, `is_link`, `is_hide`, `is_keep_alive`, `is_affix`, `is_iframe`, `icon`, `parent_id`, `parent_path`, `sort`, `created_at`, `updated_at`) VALUES (8, 1, '', 'systemMenuEdit', '', '', 'message.router.systemMenuEdit', '', 0, 1, 0, 0, '', 3, '[\"2\", \"3\"]', 0, '2023-10-19 03:58:16', '2023-10-19 03:58:16');
INSERT INTO `admin_menu` (`id`, `menu_type`, `path`, `name`, `component`, `redirect`, `title`, `is_link`, `is_hide`, `is_keep_alive`, `is_affix`, `is_iframe`, `icon`, `parent_id`, `parent_path`, `sort`, `created_at`, `updated_at`) VALUES (9, 1, '', 'systemMenuDel', '', '', 'message.router.systemMenuDel', '', 0, 1, 0, 0, '', 3, '[\"2\", \"3\"]', 0, '2023-10-19 03:58:33', '2023-10-19 03:58:33');
INSERT INTO `admin_menu` (`id`, `menu_type`, `path`, `name`, `component`, `redirect`, `title`, `is_link`, `is_hide`, `is_keep_alive`, `is_affix`, `is_iframe`, `icon`, `parent_id`, `parent_path`, `sort`, `created_at`, `updated_at`) VALUES (10, 1, '', 'systemRoleAdd', '', '', 'message.router.systemRoleAdd', '', 0, 1, 0, 0, '', 6, '[\"2\", \"6\"]', 0, '2023-10-19 06:55:59', '2023-10-19 06:55:59');
INSERT INTO `admin_menu` (`id`, `menu_type`, `path`, `name`, `component`, `redirect`, `title`, `is_link`, `is_hide`, `is_keep_alive`, `is_affix`, `is_iframe`, `icon`, `parent_id`, `parent_path`, `sort`, `created_at`, `updated_at`) VALUES (11, 1, '', 'systemUserAdd', '', '', 'message.router.systemUserAdd', '', 0, 1, 0, 0, '', 7, '[\"2\", \"7\"]', 0, '2023-10-19 06:57:35', '2023-10-19 06:57:35');
COMMIT;

-- ----------------------------
-- Table structure for admin_role
-- ----------------------------
DROP TABLE IF EXISTS `admin_role`;
CREATE TABLE `admin_role` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `role_name` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '角色名称',
  `role_key` varchar(255) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '角色标识',
  `status` tinyint NOT NULL DEFAULT '1' COMMENT '状态（0:禁用，1:启用）',
  `describe` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '描述',
  `menu_auth` json DEFAULT NULL COMMENT '权限',
  `btn_auth` json DEFAULT NULL COMMENT '按钮权限',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ux_role_key` (`role_key`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of admin_role
-- ----------------------------
BEGIN;
INSERT INTO `admin_role` (`id`, `role_name`, `role_key`, `status`, `describe`, `menu_auth`, `btn_auth`, `created_at`, `updated_at`) VALUES (1, '超级管理员', 'super_admin', 1, '超级管理员', '[\"home\", \"system\", \"systemMenu\", \"systemRole\", \"systemUser\"]', '[\"systemMenuAdd\", \"systemMenuEdit\", \"systemMenuDel\", \"systemRoleAdd\", \"systemUserAdd\"]', '2023-10-15 09:33:31', '2023-10-19 08:24:59');
INSERT INTO `admin_role` (`id`, `role_name`, `role_key`, `status`, `describe`, `menu_auth`, `btn_auth`, `created_at`, `updated_at`) VALUES (2, '普通管理员', 'admin', 1, '', '[\"home\", \"system\", \"systemMenu\", \"systemRole\", \"systemUser\"]', '[\"systemMenuAdd\"]', '2023-10-16 08:25:13', '2023-10-19 03:26:46');
INSERT INTO `admin_role` (`id`, `role_name`, `role_key`, `status`, `describe`, `menu_auth`, `btn_auth`, `created_at`, `updated_at`) VALUES (3, '客服', 'customer', 1, '', '[\"home\"]', '[\"systemMenuAdd\", \"systemMenuEdit\"]', '2023-10-16 08:32:56', '2023-10-19 07:17:43');
COMMIT;

-- ----------------------------
-- Table structure for admin_user
-- ----------------------------
DROP TABLE IF EXISTS `admin_user`;
CREATE TABLE `admin_user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码',
  `nick_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '昵称',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '头像',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `is_no_power` tinyint NOT NULL DEFAULT '0' COMMENT '是否封禁用户',
  `auth_role` json DEFAULT NULL COMMENT '角色',
  PRIMARY KEY (`id`),
  UNIQUE KEY `ux_phone` (`phone`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of admin_user
-- ----------------------------
BEGIN;
INSERT INTO `admin_user` (`id`, `phone`, `password`, `nick_name`, `avatar`, `created_at`, `updated_at`, `is_no_power`, `auth_role`) VALUES (1, 'KOGY3l5+nC0SwBn1wvn8XA==', '$2a$10$RD8faCulr50ZkF393kyMSuZbJWl5MKHzxwyD97tqq/tJedYLtOz8u', 'admin', 'https://img2.baidu.com/it/u=1978192862,2048448374&fm=253&fmt=auto&app=138&f=JPEG?w=504&h=500', '2023-09-01 09:32:39', '2023-10-18 11:56:48', 0, '[\"super_admin\"]');
INSERT INTO `admin_user` (`id`, `phone`, `password`, `nick_name`, `avatar`, `created_at`, `updated_at`, `is_no_power`, `auth_role`) VALUES (2, 'oLRa8IMHGhfJ02Xvopv5fQ==', '$2a$10$bc6jXp2HOQ3oJNyxoBIucuXHA3WY7Jj85pbW2AG5Q8xip/Min.2s2', 'admin1', '', '2023-10-18 03:47:56', '2023-10-18 11:56:56', 0, '[\"customer\"]');
COMMIT;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '手机号\n',
  `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '密码',
  `nick_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '昵称',
  `avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '头像',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `ux_phone` (`phone`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
